package wavenotes.model.image;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DatastoreImage {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Date date;
	
	@Persistent(defaultFetchGroup="false")
	private Blob originalImage;
	
	@Persistent(defaultFetchGroup="false")
	private Blob smallImage;

	public DatastoreImage(Blob originalImage) {
		this.originalImage = originalImage;
		this.date = new Date();
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Blob getOriginalImage() {
		return originalImage;
	}

	public void setOriginalImage(Blob originalImage) {
		this.originalImage = originalImage;
	}

	public Blob getSmallImage() {
		return smallImage;
	}

	public void setSmallImage(Blob smallImage) {
		this.smallImage = smallImage;
	}
}
